#ifndef DBTABLEMODEL_H
#define DBTABLEMODEL_H

#include <QAbstractTableModel>

//#include "abstractcontainer.h"
class AbstractContainer;

class DbTableModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit DbTableModel(QObject *parent = 0, AbstractContainer * storage = 0);

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role);

    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    Qt::ItemFlags flags ( const QModelIndex & index ) const;

    bool insertRow(int row, const QModelIndex &parent = QModelIndex());
    bool removeRow(int row, const QModelIndex &parent = QModelIndex());

    void setTablesList(AbstractContainer *tables);
private:
    AbstractContainer *m_tables;
    QList<QString> m_columnsName;
};

#endif // DBTABLEMODEL_H
